View subscription

This subscription type enables to populate the fields’ values of process document with data coming from VDic document such as the process instances or the Data Universe data.

The request is fully based on the views. The syntax is similar to the views definition but may be simplified if the generated view exactly corresponds to the request. In that case, you just need to reference the view, either by its ID, or by its « protocolURI » property.

Example of « onLoad » type subscription

Here is a subscription definition example based on views and processed on the document loading.

When the document is loaded, the "onLoad" type subscription will be processed. The "view" attribute enables to specify on each generated view the request must be based on. The "action-key" attribute enables to define which column of the view will be used to populate the field of the action tag. By default, if this attribute is empty, the subscription will fill in the « Field_1 » field list with the first column of the view.

<subscription name="onLoad" subscription-class="com.axemble.vdoc.sdk.mapping.extensions.ViewMappingExtension" view="-bidzawpqyday3cew6fxys">
        <action field-list="Field_1" prop-id="" throw-events="false" action-key="" />
</subscription>

Example of « onChange » type subscription

Here is subscription definition example processed on the field value change.

 
<subscription field-id="Field_1" name="onChange" prop-id=" " subscription-class="com.axemble.vdoc.sdk.mapping.extensions.ViewMappingExtension">
        <definition catalog="CustomerSupport" catalogType="4" name="DEFAULT" type="resource">
                <filters>
                        <fieldgroup operator="AND">
                                <field name="sys_ResourceTemplate" value="Test"/>
                                <field name="Column_1" value="$Document.Value('Field_1')"/>
                        </fieldgroup>
                </filters>
                <view>
                        <column name="Column_2"/>
                </view>
        </definition>
        <action field-list="Field_2"/>
</subscription>
 

The second view subscription example will run on altering the value of the "Field_1" field. The « Field_2 » will get the value of the « column_2 ». The definition tag enables to define a view dynamically. The syntax is the same as the one used for the generated views.

subscription

The "subscription" element defines the subscription input. Used in the resource template XML.

Element Description Where to find more information?
field-id Modified document field and trigger of the "onChange" event.
name Name of occurred event
prop-id Not available
subscription-class Extension class: “com.axemble.vdoc.sdk.mapping.extensions.ViewMappingExtension”

on-stage

The "on-stage" element defines the input of a step on which the subscription will be run.

Element Description Where to find more information?
name System name of the concerned step The keyword « sys_CreationWizard »enables to indicate that the treatment will be processed only on the action of process document creation.

definition

The "definition" element defines the dynamic view that will be processed. The syntax is the same as the generated views.

action

The "action" element defines the input of an action to be performed after an event is triggered. Used in the resource template XML.

Element Description Where to find more information?
field-id System name of the subscribed field
prop-id Not available
throw-events
update-mode
field-list / field-value Request field that will be used to update the document field based on whether it is of list type (field-list) or not (field-value).

The actions

Actions define all the document fields that will be updated when subscription is run. Actions can only be defined at the XML document level of the resource template. It is possible to define 1 to n actions.

The filters

Filters on steps can be placed to restrict subscriptions running on some steps. If no step has been specified, the subscription will be valid at all steps of the document. Filters are defined at the XML document level of the resource template. The on-stage tags can be present from 0 to n times.